/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.guet.careapp.pojo;

import java.io.Serializable;
import java.math.BigInteger;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author LXM
 */
@Entity
@Table(name = "t_log_userlogin")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TLogUserlogin.findAll", query = "SELECT t FROM TLogUserlogin t"),
    @NamedQuery(name = "TLogUserlogin.findById", query = "SELECT t FROM TLogUserlogin t WHERE t.id = :id"),
    @NamedQuery(name = "TLogUserlogin.findByLoginTime", query = "SELECT t FROM TLogUserlogin t WHERE t.loginTime = :loginTime"),
    @NamedQuery(name = "TLogUserlogin.findByIp", query = "SELECT t FROM TLogUserlogin t WHERE t.ip = :ip"),
    @NamedQuery(name = "TLogUserlogin.findByFinalTime", query = "SELECT t FROM TLogUserlogin t WHERE t.finalTime = :finalTime")})
public class TLogUserlogin implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Column(name = "login_time")
    private BigInteger loginTime;
    @Size(max = 255)
    @Column(name = "ip")
    private String ip;
    @Column(name = "final_time")
    private BigInteger finalTime;
    @JoinColumn(name = "user_id", referencedColumnName = "u_id")
    @ManyToOne(optional = false)
    private TUserInfo userId;

    public TLogUserlogin() {
    }

    public TLogUserlogin(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public BigInteger getLoginTime() {
        return loginTime;
    }

    public void setLoginTime(BigInteger loginTime) {
        this.loginTime = loginTime;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public BigInteger getFinalTime() {
        return finalTime;
    }

    public void setFinalTime(BigInteger finalTime) {
        this.finalTime = finalTime;
    }

    public TUserInfo getUserId() {
        return userId;
    }

    public void setUserId(TUserInfo userId) {
        this.userId = userId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TLogUserlogin)) {
            return false;
        }
        TLogUserlogin other = (TLogUserlogin) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pojo.TLogUserlogin[ id=" + id + " ]";
    }
    
}
